%file: read.m
%date: 041604
%action: calls readDisplayData.m, imagePad.m convolver2D.m, gausspyr.m and laplacepyr.m to read, 
% pad, display, flter, subsample, compute gaussian and laplacian pyramids for an image


clear all;
close all
name='q1i1_576x432';
width = 576;
height = 432;
border = 2;
level = 6;

x=[1, 4, 6, 4, 1]/16;
y=[1, 4, 6, 4, 1]/16;

%read image q1i1_576x432 (name)
firstImage=readDisplayData(name, width, height);

%pad this image and display it
secondImage=imagePad(firstImage, border, width, height);

%smoothing the image
thirdImage = convolve2D(secondImage, border, x, y, width, height);

%subsample the image
fourthImage=subsample2D(thirdImage);

%compute the gauss pyramids
fifthImage = gausspyr(secondImage, 1, border, x, y);

%compute the laplacian
%sixthImage = laplacepyr(secondImage, level, border, x, y);
    
%expand the last image
%seventhImage=expand2D(sixthImage)

